﻿using System;
using MSAcademic.v2.Infrastructure.Picture;

namespace MSAcademic.v2.Web.Areas.Admin.Models.Picture
{
    public partial class EditPictureViewModel
    {
        public int PictureId { get; set; }
        public string PictureCaption { get; set; }
        public int GalleryId { get; set; }
        public bool PictureIsHidden { get; set; }
        public string CroppedPictureUrl { get; set; }
        public string OriginalPictureUrl { get; set; }
        
    }
    public partial class EditPictureViewModel
    {
        public IPicture Picture
        {
            get
            {
                if (_picture == null)
                {
                    _picture = new Lazy<IPicture>(() => _pictureQueries.GetPicture(this.PictureId));
                    
                    
                }
                return _picture.Value;
            }
        }
        
        private Lazy<IPicture> _picture;
        public string OriginalUrl
        {
            get
            {
                if (_originalUrl == null)
                {
                    _originalUrl = new Lazy<string>(() => _PictureService.GetOriginalFrontPictureUrl(_pictureQueries.GetPicture(this.PictureId).Url));
                }
                return _originalUrl.Value;
            }
        }
        private Lazy<string> _originalUrl;
        
    }
    public partial class EditPictureViewModel
    {
        public IPictureQueries _pictureQueries;
        public IPictureService _PictureService;
        public EditPictureViewModel(IPictureQueries pictureQueries, IPictureService PictureService)
        {
            _pictureQueries = pictureQueries;
            _PictureService = PictureService;
        }
        public EditPictureViewModel()
        {
            
        }

    }
}